<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    class Square {
        constructor(length) {
            this.length = length;
        }
        getArea() {
            alert(this.length * this.length)
        }
        getRoundLength() {
            alert(this.length * 4)
        }
    }
    class Rectangle extends Square {
        constructor(length, width) {
            super(length)
            this.width = width;
        }
        getArea() {
            alert(this.width * this.length)
        }
        getRoundLength() {
            alert((this.width + this.length) * 2)
        }

    }
    let o = new Square(2)
    o.getArea()
    let a = new Rectangle(2, 3)
    a.getRoundLength()
</script>

</html>